<template>
  <el-container>
    <el-header>分数统计</el-header>
    <el-form :model="form" label-width="80px">
      <el-table :data="allGrades" border stripe>
        <el-table-column label="课号" prop="cno"></el-table-column>
        <el-table-column label="课名" prop="cname"></el-table-column>
        <el-table-column label="100-90分" prop="grade"></el-table-column>
        <el-table-column label="90-80分" prop="sno"></el-table-column>
        <el-table-column label="80-70分" prop="sname"></el-table-column>
        <el-table-column label="70-60分" prop="syear"></el-table-column>
        <el-table-column label="60分以下" prop="smajor"></el-table-column>
      </el-table>
    </el-form>
  </el-container>
</template>

<script>
export default {
  created() {
    this.allGrade();
  },
  data() {
    return {
      form: {},
      query: {
        cno: "",
        cname: "",
        grade: "",
        sno: "",
        sname: "",
        syear: "",
        smajor: ""
      },
      allGrades: [],
      total: 0
    }
  },
  methods: {
    async allGrade() {
      this.$axios.post("http://localhost:8081/allGrade", this.query).then(res => {
        console.log(res.data);
        this.allGrades = res.data;
      })
    }
  }
};
</script>

<style scoped>
.el-header {
  color: #333;
  line-height: 60px;
  font-size: 40px;
}
</style>